package com.xqboss.apps.mapper.order;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xqboss.apps.domain.order.OrderMain;
import com.xqboss.apps.dto.market.MarketBoxInfoDto;
import com.xqboss.apps.dto.market.MarketResellDto;
import com.xqboss.apps.dto.order.WebOrderListDto;
import com.xqboss.apps.vo.market.MarketNormalResellVo;
import com.xqboss.apps.vo.market.MarketResellBoxInfoVo;
import com.xqboss.apps.vo.market.WebMarketResellBoxInfoVo;
import com.xqboss.apps.vo.order.AppOrderListExportVo;
import com.xqboss.apps.vo.order.AppOrderListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Trent
 * @date 2023/8/21
 */
@Mapper
public interface OrderMainMapper extends BaseMapper<OrderMain> {

    /**
     * 获取用户商品已购买数量
     *
     * @param userId
     * @param spuId
     * @param isPriority
     * @return
     */
    public int countByUserSpuOrder(@Param("userId") Long userId, @Param("spuId") Long spuId, @Param("isPriority") boolean isPriority);

    /**
     *  获取订单列表
     * @param params
     */
    List<OrderMain> getOrderList(WebOrderListDto params);

    /**
     *  获取订单列表V2
     * @param params
     */
    Page<AppOrderListVo> getOrderListV2(Page<OrderMain> page, @Param("params") WebOrderListDto params);

    List<MarketNormalResellVo> resellNormalAndEquipmentRecord(@Param("params") MarketResellDto params, @Param("userId") Long userId);

    List<MarketResellBoxInfoVo> resellRecordBoxInfo(@Param("params") MarketBoxInfoDto params, @Param("userId") Long userId);

    List<WebMarketResellBoxInfoVo> webResellRecordBoxInfo(@Param("params") MarketBoxInfoDto dto, @Param("userId") Long userId);

    List<AppOrderListExportVo> export(WebOrderListDto params);
}
